import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        char[] arr=scanner.nextLine().toCharArray();
        int[] hash=new int[26];
        for(int i=0;i< arr.length;i++){
            hash[arr[i]-'A']++;
        }
        int max=hash[0];
        String result="A";
        for (int i=0;i<hash.length;i++){
            if(hash[i]>max){
                max=hash[i];
                result=" "+(char)(i+'A');
            }
            else if(hash[i]==max){
                result+=(char)(i+'A');
            }
        }
        System.out.println(result);
    }
}